home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / p_man / cat3 / f90 / pxfisdir.z / pxfisdir
Text File  |  1998-10-30  |  3KB  |  83 lines

  1. PXFISDIR(3F)                                           Last changed: 1-6-98
  2.  
  3.  
  4. NNAAMMEE
  5.      PPXXFFIISSDDIIRR - Tests for directory file
  6.  
  7. SSYYNNOOPPSSIISS
  8.      LLOOGGIICCAALL FFUUNNCCTTIIOONN PPXXFFIISSDDIIRR((_m))
  9.      IINNTTEEGGEERR _m
  10.  
  11. IIMMPPLLEEMMEENNTTAATTIIOONN
  12.      UNICOS, UNICOS/mk, and IRIX systems
  13.  
  14. SSTTAANNDDAARRDDSS
  15.      IEEE standard interface for FORTRAN 77
  16.  
  17. DDEESSCCRRIIPPTTIIOONN
  18.      On IRIX systems, this routine is in lliibbffffiioo..ssoo which is linked by
  19.      default when compiling programs with the MIPSpro 7 Fortran 90 compiler
  20.      or when compiling programs with the --ccrraayylliibbss option to the MIPSpro
  21.      7.2 F77 compiler.
  22.  
  23.      The logical function PPXXFFIISSDDIIRR checks if a file is a directory file.
  24.      The argument _m should be supplied by the sstt__mmooddee component of the ssttaatt
  25.      structure used by the PPXXFFSSTTAATT(3F) routine.
  26.  
  27.      When using the CF90 compiler or MIPSpro 7 Fortran 90 compiler on
  28.      UNICOS, UNICOS/mk, or IRIX systems, all arguments must be of default
  29.      kind unless documented otherwise.  On UNICOS and UNICOS/mk, default
  30.      kind is KKIINNDD==88 for integer, real, complex, and logical arguments; on
  31.      IRIX, the default kind is KKIINNDD==44.
  32.  
  33.      The following argument is available for this routine:
  34.  
  35.      _m    An input integer variable containing the file mode.
  36.  
  37.      If the file is a directory file, PPXXFFIISSDDIIRR returns a logical true,
  38.      otherwise a logical false is returned.
  39.  
  40. EEXXAAMMPPLLEESS
  41.      In this example, the directory // is opened and read until a directory
  42.      is found or the end of the directory is reached. If a directory is
  43.      found, ffoouunndd aa ddiirreeccttoorryy iinn // is displayed.
  44.  
  45.           program pxftest
  46.           integer ierror,mode,ilen,EEND
  47.           integer idirid,jdirent,jstat
  48.           logical PXFISDIR, found
  49.           character*30 name, path
  50.  
  51.           CALL PXFSTRUCTCREATE('dirent',jdirent,ierror)
  52.           CALL PXFSTRUCTCREATE('stat',jstat,ierror)
  53.           CALL PXFCONST('EEND',EEND,ierror)
  54.           path = '/'
  55.           CALL PXFOPENDIR(path,0,idirid,ierror)
  56.           CALL PXFCHDIR(path,0,ierror)
  57.           found = .FALSE.
  58.  
  59.           do while (found .eqv. .FALSE.)
  60.              CALL PXFREADDIR(idirid,jdirent,ierror)
  61.              if (ierror .eq. EEND) then
  62.                 exit
  63.              endif
  64.              CALL PXFSTRGET(jdirent,'d_name',name,ilen,ierror)
  65.              CALL PXFSTAT(name,0,jstat,ierror)
  66.              CALL PXFINTGET(jstat,'st_mode',mode,ierror)
  67.              if (PXFISDIR(mode)) then
  68.                 found = .TRUE.
  69.              endif
  70.           enddo
  71.  
  72.           if (found .eqv. .TRUE.) then
  73.              print *,'found a directory in /'
  74.           endif
  75.           end
  76.  
  77. SSEEEE AALLSSOO
  78.      PPXXFFCCOONNSSTT(3F), PPXXFFIINNTTSSEETT(3F), PPXXFFSSTTAATT(3F), PPXXFFSSTTRRUUCCTTCCRREEAATTEE(3F)
  79.  
  80.      _A_p_p_l_i_c_a_t_i_o_n _P_r_o_g_r_a_m_m_e_r'_s _L_i_b_r_a_r_y _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, publication SR-
  81.      2165, for the printed version of this man page.
  82.  
  83.